<template>
    <div style="font-size: 14px;">

        <el-row>
            <span class="first-title">会诊申请单</span>
        </el-row>
        <el-row>
            <span class="second-title">基本信息</span>
        </el-row>
        <el-row>
            <el-col :span="6">
                会诊医院:{{printData.serviceCenterName}}
            </el-col>
            <el-col :span="6">
                会诊类型:{{printData.typeOfConsultationName}}
            </el-col>
            <!--术中冰冻-->
            <el-col
                :span="6"
                v-if="printData.typeOfConsultation === 1357"
            >
                预约时间:{{printData.frozenAppointmentTime}}
            </el-col>
            <el-col
                :span="6"
                v-if="printData.typeOfConsultation === 1357"
            >
                上午下午:{{printData.morningAndAfternoonName}}
            </el-col>
        </el-row>
        <el-row>
            <el-col :span="6">
                送检医院:{{printData.sendingHospitalName}}
            </el-col>
            <el-col :span="6">
                送检医生:{{printData.sendingDoctor}}
            </el-col>
            <el-col :span="6">
                医生手机:{{printData.sendingDoctorPhone}}
            </el-col>
            <el-col :span="6">
                送检时间:{{printData.createTime}}
            </el-col>
        </el-row>
        <el-row>
            <span class="second-title">病理信息</span>
        </el-row>
        <el-row>
            <el-col :span="6">
                病理号:{{printData.pathologyId}}
            </el-col>
            <el-col :span="6">
                姓名:{{printData.name}}
            </el-col>
            <el-col :span="6">
                性别:{{printData.sexName}}
            </el-col>
            <el-col :span="6">
                年龄:{{printData.age}}岁
            </el-col>
        </el-row>
        <el-row>
            <el-col :span="6">
                手机号码:{{printData.cellphone}}
            </el-col>
            <el-col :span="6">
                联系人姓名:{{printData.contactName}}
            </el-col>
            <el-col :span="6">
                身份证号:{{printData.identicalNumber}}
            </el-col>
            <el-col :span="6">
                联系人微信:{{printData.contactWeChat}}
            </el-col>
        </el-row>
        <el-row>
            <el-col :span="6">
                住院号:{{printData.hospitalNumber}}
            </el-col>
            <el-col :span="6">
                床号:{{printData.bedNo}}
            </el-col>
            <el-col :span="6">
                取材脏器:{{printData.visceraName}}
            </el-col>
            <el-col :span="6">
                标本类别:{{printData.specimenCategoryName}}
            </el-col>
        </el-row>
        <el-row>
            <el-col :span="6">
                病区:{{printData.ward}}
            </el-col>
            <el-col :span="6">
                曾就诊医院:{{printData.usedHospitals}}
            </el-col>
        </el-row>
        <el-row>
            <el-col :span="11">
                病史摘要:{{printData.diagnosisHistory}}
            </el-col>
            <el-col
                :span="11"
                :offset="1"
            >
                临床诊断:{{printData.diagnosisContent}}
            </el-col>
        </el-row>
        <el-row>
            <el-col :span="11">
                原病理诊断:{{printData.orginalPhythologyDiagnosis}}
            </el-col>
            <el-col
                :span="11"
                :offset="1"
            >
                免疫组化、分子病理结果:{{printData.resultPhythologyDiagnosis}}
            </el-col>
        </el-row>
        <el-row>
            <el-col :span="11">
                大体观察巨检:{{printData.pathologyObserved}}
            </el-col>
        </el-row>
        <el-row>
            <span class="second-title">快递信息</span>
        </el-row>
        <div
            v-for="item in expressInfoList"
            :key="item.index"
        >
            <el-row>
                <el-col :span="12">
                    快递时间:{{item.sendTime}}
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="6">
                    蜡块:{{item.waxBlock}}
                </el-col>
                <el-col :span="6">
                    白片几张:{{item.whitePiece}}
                </el-col>
                <el-col :span="6">
                    HE切片几张:{{item.HE}}

                </el-col>
                <el-col :span="6">
                    免疫组化切片:{{item.immunohistochemical}}
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="6">
                    放射胶片:{{item.radiationFilm}}
                </el-col>
                <el-col :span="6">
                    纸质文本:{{item.paperText}}
                </el-col>
                <el-col :span="6">
                    寄件人:{{item.consignor}}
                </el-col>
                <el-col :span="6">
                    寄件人电话:{{item.consignorPhoneNumber}}
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="6">
                    送检方式:{{item.inspectionMethod}}
                </el-col>
                <el-col :span="6">
                    快递公司:{{item.expressName}}
                </el-col>
                <el-col :span="6">
                    快递单号:{{item.expressNumber}}
                </el-col>
            </el-row>
            <el-row>
                送检备注:{{item.remark}}
            </el-row>
        </div>

        <el-row style="margin-top:50px">
            <el-col :span="12">打印人:{{printData.sendingDoctor}}</el-col>
            <el-col :span="12">打印日期:{{nowDateTime}}</el-col>
        </el-row>
        <el-row>
            请把此会诊申请单与标本一起寄送给接受会诊医院，以方便会诊医院签收标本
        </el-row>
        <div class="barcode-box">
            <img
                id="barcode"
                style="width: 220px"
            />
        </div>

    </div>
</template>

<script>
import jsbarcode from 'jsbarcode'
import { getNowTime } from '@/libs/util'
export default {
  name: 'ConsultationRequestForm',
  props: ['printData', 'expressInfo'],
  data() {
    return {
      nowDateTime: ''
    }
  },
  computed: {
    expressInfoList() {
      return this.expressInfo.filter(item => item.type === 1)
    }
  },
  mounted() {
    const serialNumber = this.printData.serialNumber
    jsbarcode('#barcode', serialNumber, {
      displayValue: true // 是否在条形码下方显示文字
    })
    this.nowDateTime = getNowTime()
  },
  methods: {}
}
</script>

<style scoped>
.first-title {
  font-weight: 700;
  font-size: 18px;
  display: block;
  margin: 0 auto;
  width: 90px;
  line-height: 50px;
}
.second-title {
  font-weight: 700;
  font-size: 16px;
  line-height: 30px;
}
.el-row {
  margin-top: 10px;
}
.barcode-box {
  position: absolute;
  top: 35px;
  right: 20px;
}
</style>
